import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
import router from "./router";
// 权限初始化
import "./permission";

const app = createApp(App);

// 全局样式格式化
import "@/assets/css/init.css";

// 引入ts文件对应的全局注册的组件的配置
import components from "./components/global-component";

// element-plus
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import { ElMessage } from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 自定义指令
import directive from "./directives";

// jquery
import $ from "jquery";
window.$ = $;

app.config.globalProperties.$message = ElMessage;

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(router);
app.use(components);
app.use(ElementPlus);
app.use(directive)

app.mount("#app");
